<?php
/**
 * 系统用户模型
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/9 0009
 * Time: 16:11
 */
namespace app\admin\model;

use think\Model;
use traits\model\SoftDelete;
class SystemUser extends Model{
    use SoftDelete;
    protected $table = 'system_user';

    protected $deleteTime  = 'delete_at';
    protected $updateTime = 'update_at';


    /**
     * 生成加密密码
     * @param string $pass 原始密码
     * @return arr 返回值['password'=> , 'salt'=> ];
     */
    public static function createPass($pass,&$data){
        if($pass){
            $data['salt'] = getSalt(6);
            $data['password'] = md5(md5(trim($pass)).$data['salt']);
        }
    }


}